/*
 * This file is part of Cadmium.
 * Copyright (C) 2007-2010 Xavier Clerc.
 *
 * Cadmium is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Cadmium is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package fr.x9c.cadmium.kernel;

/**
 * This class is a bare data object representing a location information
 * used for backtrace handling.
 *
 * @author <a href="mailto:cadmium@x9c.fr">Xavier Clerc</a>
 * @version 1.2
 * @since 1.2
 */
public final class LocInfo {

    /** Whether the location information is valid. */
    public final boolean valid;

    /** Whether the location information stems from a <tt>RAISE</tt> instruction. */
    public final boolean isRaise;

    /** Source filename. */
    public final String filename;

    /** Source line number. */
    public final int lnum;

    /** Source starting character. */
    public final int startChr;

    /** Source ending character. */
    public final int endChr;

    /**
     * Constructs a new location information.
     * @param v whether the location information is valid
     * @param r whether the location information stems from a <tt>RAISE</tt> instruction
     * @param f source filename - should not be <tt>null</tt>
     * @param l source line number
     * @param s source starting character
     * @param e source ending character
     */
    public LocInfo(final boolean v,
                   final boolean r,
                   final String f,
                   final int l,
                   final int s,
                   final int e) {
        assert f != null : "null f";
        this.valid = v;
        this.isRaise = r;
        this.filename = f;
        this.lnum = l;
        this.startChr = s;
        this.endChr = e;
    } // end constructor(boolean, boolean, String, int, int, int)

} // end class 'LocInfo'
